package com.zzy.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzy.system.domain.PurchaseInStockOrderDetail;
import com.zzy.system.domain.PurchaseOrderDetail;
import com.zzy.system.mapper.PurchaseInStockOrderDetailMapper;
import com.zzy.system.mapper.PurchaseOrderDetailMapper;
import com.zzy.system.service.IPurchaseInStockOrderDetailService;
import com.zzy.system.service.IPurchaseOrderDetailService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class PurchaseInStockOrderDetailServiceImpl extends ServiceImpl<PurchaseInStockOrderDetailMapper, PurchaseInStockOrderDetail> implements IPurchaseInStockOrderDetailService {
    private static final Logger log = LoggerFactory.getLogger(PurchaseInStockOrderDetailServiceImpl.class);

    @Override
    public void saveOrderDetail(PurchaseInStockOrderDetail purchaseOrderDetail) {
        QueryWrapper<PurchaseInStockOrderDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("in_stock_sheet_id", purchaseOrderDetail.getInStockSheetId());
        baseMapper.delete(queryWrapper);
        this.save(purchaseOrderDetail);
    }
}